Skip to content

Apply PRD DEFAULT row decisions across token interfaces#3

Merged
amiecorso merged 1 commit into
masterfrom
amie/default-token-decisions
May 15, 2026
Merged

Apply PRD DEFAULT row decisions across token interfaces#3
amiecorso merged 1 commit into
masterfrom
amie/default-token-decisions

Conversation

@amiecorso
Copy link
Copy Markdown
Collaborator

Summary

Incorporates the team's DEFAULT row decisions from the BOP Home PRD tab, reconciles the variant interfaces with the new IDefaultToken behavior, and aligns errors and events with the OZ AccessControl convention (ERC20 / ERC2612 prefixes dropped per local convention).

IDefaultToken (the bulk)

  • Roles: 5 named (`DEFAULT_ADMIN_ROLE`, `MINT_ROLE`, `BURN_ROLE`, `PAUSE_ROLE`, `UNPAUSE_ROLE`). Plain OZ AccessControl semantics, no two-step admin transfer with delay. Last-admin guard (cannot renounce if only admin).
  • Mutable name / symbol: `setName`, `setSymbol` admin-only with `NameUpdated` / `SymbolUpdated` events.
  • Redeem on the Default surface: `redeem`, `redeemWithMemo`, `minimumRedeemable`, `setMinimumRedeemable`, plus `Redeemed` event. Authorization via redeemer slot in the compound `transferPolicyId`. No role required: tokens that don't want redemption configure their policy's redeemer slot to always-reject.
  • Granular pause bitfield: `pause(uint256 vectors)` additive, `unpause()` clears all. New `PauseVectors` library: `MINT` / `BURN` / `TRANSFER` / `REDEEM` at bits 0..3.
  • Single `Memo` event: `Memo(bytes32 indexed memo)` paired with adjacent `Transfer` event by indexers via `(txHash, logIndex - 1)`. Removed per-operation memo events.
  • EIP-2612 permit, EOA only: dropped ERC-1271 contract-sig overload. Added ERC-5267 `eip712Domain()` for domain introspection.
  • Capability bits trimmed to `PAUSABLE` and `CAP_MUTABLE`. Removed `MINTABLE`, `BURNABLE`, `BURN_BLOCKED`, `ADMIN_MUTABLE`, `POLICY_MUTABLE`, `URI_MUTABLE` per PRD decisions or because they're achievable via existing primitives (e.g. fixed-supply via `supplyCap == initialSupply` plus `CAP_MUTABLE` unset).
  • Errors aligned with OZ AccessControl + ERC-6093 + ERC20Permit: `AccessControlUnauthorizedAccount`, `AccessControlBadConfirmation`, `InsufficientBalance`, `InsufficientAllowance`, `InvalidSender`, `InvalidReceiver`, `InvalidApprover`, `InvalidSpender`, `ExpiredSignature`, `InvalidSigner`. ERC20 / ERC2612 prefixes dropped per local convention; AccessControl prefix retained.
  • Events aligned with OZ AccessControl: separate `RoleGranted` / `RoleRevoked` / `RoleAdminChanged` events matching OZ exactly.
  • Documented spender-policy check: `transferFrom` policy hook validates `from`, `to`, AND `msg.sender` (the spender, when distinct from `from`). Treated as another sender check on the existing IPolicyRegistry surface.

IStablecoin (75% line reduction, 223 → 56)

Trimmed to just `currency()`. Per-minter rate limiting and ERC-3009 are now wrapper / periphery concerns. Bridge's TIP20Controller pattern and CCS's mint flow are both expressible via wrapping contracts that hold `MINT_ROLE` on the precompile. Sanctions seizure is also a periphery concern.

ISecurityToken

Removed redundant `redeem` family (inherited from IDefaultToken) and `redeemPolicyId` (folded into the compound `transferPolicyId` redeemer slot). Removed conflicting `NameUpdated` / `SymbolUpdated` events (use inherited events plus `Announcement` correlation by tx hash). Added `ISSUER_ROLE` declaration. Changed `adminBurn` role from `BURN_BLOCKED_ROLE` (no longer exists) to `ISSUER_ROLE` for consistency with `adminMint`. All security-specific features preserved: announcements, share ratio, `create`, `adminMint` / `adminBurn`, security identifiers, `updateName` / `updateSymbol` with announcement coupling.

ITokenFactory

Dropped `defaultAdminDelay` (no two-step admin) and `redeemPolicyId` from all three params structs. Added `minimumRedeemable` to Default and Stablecoin params (since redeem moved to default). Updated all NatSpec to remove MINTABLE references and document the cap-based fixed-supply pattern.

Capabilities.sol

Default bits trimmed to `PAUSABLE` (1<<0) and `CAP_MUTABLE` (1<<1). Stablecoin variant bits removed entirely. Security variant bits unchanged. Presets updated accordingly.

PauseVectors.sol (new)

Library defining the granular pause bitmask: `MINT`, `BURN`, `TRANSFER`, `REDEEM` at bits 0..3.

`forge build` clean across all interface files.

@amiecorso amiecorso merged commit 374465c into master May 15, 2026
1 check passed
@ilikesymmetry ilikesymmetry deleted the amie/default-token-decisions branch May 19, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant